﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Wordpress.Phone.Models;

namespace Wordpress.Phone.ViewModels
{
    public class DetailViewModel : ViewModelBase
    {
        
        protected Movie movie;

        public Movie Movie
        {
            get
            {
                return this.movie;
            }

            set
            {
                if (value != this.movie) {
                    this.movie = value;
                    this.OnNotifyPropertyChanged("Movie");
                }
            }
        }
        
        public string Title
        {
            get
            {
                return this.Movie.Title;
            }

            set
            {
                if (value != this.Movie.Title) {
                    this.Movie.Title = value;
                    this.OnNotifyPropertyChanged("Title");
                }
            }
        }

        public DetailViewModel() : base () {
            this.Movie = new Movie();    
        }
        
        public void Load(int index)
        {
            this.CurrentIndex = index;
            this.Movie = this.data.Movies[this.CurrentIndex];
        }
    }
}
